#include "motorcommand.h"
#include "system.h"
#include "motorcontrol.h"

void motor_parse_cmd()
{
    BOOL res = FALSE;
    UINT8 rdata = 0;

    res = sys_uart_read_byte(&rdata);

    if(res == TRUE)
    {
        switch(rdata)
        {
            case '0':
            {
                motor_shift_gear(MOTOR_INDEX_Y, MOTOR_DIRECTION_L, MOTOR_GEAR_NULL);
                break;
            }
            case '1':
            {
                motor_shift_gear(MOTOR_INDEX_Y, MOTOR_DIRECTION_L, MOTOR_GEAR_LS);
                break;
            }
            case '2':
            {
                motor_shift_gear(MOTOR_INDEX_Y, MOTOR_DIRECTION_L, MOTOR_GEAR_MS);
                break;
            }
            case '3':
            {
                motor_shift_gear(MOTOR_INDEX_Y, MOTOR_DIRECTION_L, MOTOR_GEAR_HS);
                break;
            }
            case '4':
            {
            }
            case '5':
            {
            }
        }

        sys_uart_send_byte(rdata);
    }
}



